<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="./Public/Admin/Bootstrap/Css/bootstrap.min.css" />
	<script type="text/javascript" src='./Public/Admin/js/jquery-1.8.2.min.js'></script>
	<style type="text/css">
		body{
			margin-bottom: 100px;
		}
	</style>
</head>
<body>
	<div class="container-fluid">
	<div class="row-fluid">
	<div class="span12">
		<table class='table table-bordered table-hover'>
			<tr>
				<th>货品ID</th>
				<?php foreach ($newData as $key=>$v){?>
					<th><?php echo $key?></th><!-- 这儿是规格(颜色、尺寸等),得用循环 -->
				<?php }?>
				
				<th>库存</th>
				<th>货号</th>
				<th>操作</th>
			</tr>
			<?php foreach ($GoodsListData as $v){?>
				<tr class="info">
					<td><?php echo $v['glid']?></td>
					<?php foreach ($v['combine'] as $value){?>
						<td><?php echo $value?></td>
						<!-- 这儿是规格(颜色、尺寸、身高等),得用循环 -->
					<?php }?>
					<td><?php echo $v['inventory']?></td>
					<td><?php echo $v['number']?></td>
					<td>
						<a href="<?php echo U('GoodsList/edit',array('glid'=>$v['glid'],'gid'=>$_GET['gid']))?>" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
						<a href="javascript:if(confirm('确定删除吗？')) location.href='<?php echo U('GoodsList/del',array('glid'=>$v['glid'],'gid'=>$_GET['gid']))?>';" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>

					</td>
				</tr>
				<?php }?>
			<!-- 如果已添加数目小于可能情况数目，才出现添加货品的输入框 -->
		<form action="" method='post' id="submit1"  >
			<tr class="info">
				<td>添加货品</td>
				<?php foreach ($newData as $value){?>
					<td>
						<select name="combine[]" style="width: 120px;">
							<option value="0">-请选择-</option>
							<?php foreach ($value as $ke=>$va){?>
								<option value="<?php echo $ke?>"><?php echo $va?></option>
							<?php }?>
						</select>
					</td>
					<?php }?>
				<!-- 这儿是规格(颜色、尺寸、身高等),得用循环 -->
				<td>
					<input type="text" name='inventory'  style="width: 120px;"/>
				</td>
				<td>
					<input type="text" name='number' value="" style="width: 120px;"/>
				</td>
				<td></td>
			</tr>
		</table>
		<input type="hidden" name="gid" value="<?php echo $_GET['gid']?>" />
		<input type="submit" value='保存添加' class="btn btn-primary" name="submit" />
	</form>

	</div>
	</div>
	</div>
</body>
</html>